pub fn new_count_distinct(input_str: &str) -> usize {
    let mut  table = Table::new();
    table.process(input_str);
    table.out()
}


use std::collections::HashMap;


struct Table {
    table: HashMap<String, usize>,
}

impl Table {
    fn new() -> Self {
        Table {
            table: HashMap::new(),
        }
    }

    fn process(&mut self, input_str: &str) {
        let strs: Vec<String> = input_str.split(',').map(|s| s.trim().to_string()).collect();
        for i in strs {
            self.table.entry(i).and_modify(|f| *f += 1).or_insert(0);
        }
    }
    fn out(&self)-> usize{
        self.table.len() as usize
    }
}
